package com.example.demo.model.controller;


import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.example.demo.datamatch.entity.YzTestMatch;
import com.example.demo.impdatalog.entity.ImpdataLog;
import com.example.demo.model.service.DemoComponent;
import com.example.demo.model.service.GreenPlumComponent;
import com.example.demo.model.service.OracleComponent;
import com.example.demo.student.entity.Student;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;

import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * <p>
 * 前端控制器
 * </p>
 *
 * @author yuanzheng
 * @since 2021-05-28
 */
@RestController
@RequestMapping("/student")
public class DemoController {

    @Autowired
    private DemoComponent demoComponent;

    @Autowired
    private OracleComponent oracleComponent;

    @Autowired
    private GreenPlumComponent greenPlumComponent;

    @PostMapping("/list")
    public List<Student> getStudentList() {
        return demoComponent.getStudents();
    }

    @PostMapping("/matchList")
    public List<YzTestMatch> getMatchList() {
        return oracleComponent.getMatchList();
    }

    @PostMapping("/gp")
    public List<YzTestMatch> getMatchInfo() {
        return greenPlumComponent.getMatchList();
    }

    @PostMapping("/impdatalogList")
    public Page<ImpdataLog> getImpdataLogList(){
        return greenPlumComponent.getImpdataLogList();
    }

}

